package com.topscomm.pm.script;

import com.topscomm.cbo.pojo.CboApprovalNodeInsEntity;
import com.topscomm.pm.PmScript;
import com.topscomm.pm.service.impl.PmRecBillService;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.SpringUtil;
import com.topscomm.tap.ITapService;
import com.topscomm.tap.TapEntity;

public class PmRecBillScript extends PmScript {
    /**
     * @author: wushenghong
     * @date: 2020/6/4
     * @description: 项目收款金额更新
     */
    public void updateReceiptMoneyToProject(ITapService service, TapEntity entity) throws Exception {
        // 审批节点实例
        CboApprovalNodeInsEntity nodeIns = (CboApprovalNodeInsEntity) entity;
        String sourceId = ConvertUtil.convertToString(nodeIns.getSourceid());
        PmRecBillService pmRecBillService = (PmRecBillService) SpringUtil.getBean("pmRecBillService");
        pmRecBillService.updateRecBillMoneyToProject(sourceId);
    }
}
